home *** CD-ROM | disk | FTP | other *** search
Wrap
// Copyright (C) 1997-2002 Alias|Wavefront, // a division of Silicon Graphics Limited. // // The information in this file is provided for the exclusive use of the // licensees of Alias|Wavefront. Such users have the right to use, modify, // and incorporate this code into other products for purposes authorized // by the Alias|Wavefront license agreement, without fee. // // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. // // // Alias|Wavefront Script File // MODIFY THIS AT YOUR OWN RISK // // Creation Date: August 2001 // // Description: // This script is the import clip to character option box dialog. // // Input Arguments: // None. // // Return Value: // None. // proc setOptionVars (int $forceFactorySettings) { // import clip to timeline // if ($forceFactorySettings || !`optionVar -exists ImportClipToTimeline`) { optionVar -intValue ImportClipToTimeline 1; } } // // Procedure Name: // ImportClipToCharSetup // // Description: // Update the state of the option box UI to reflect the option values. // // Input Arguments: // parent - Top level parent layout of the option box UI. // Required so that UI object names can be // successfully resolved. // // forceFactorySettings - Whether the option values should be set to // default values. // // Return Value: // None. // global proc ImportClipToCharSetup (string $parent, int $forceFactorySettings) { // Retrieve the option settings // setOptionVars( $forceFactorySettings ); setParent $parent; // import to timeline // int $toTimeline = `optionVar -query ImportClipToTimeline`; if ($toTimeline) { radioButtonGrp -e -sl 1 scheduleMethod; } else { radioButtonGrp -e -sl 1 moveToLibraryMethod; } } // // Procedure Name: // ImportClipToCharCallback // // Description: // Update the option values with the current state of the option box UI. // // Input Arguments: // parent - Top level parent layout of the option box UI. Required so // that UI object names can be successfully resolved. // // doIt - Whether the command should execute. // // Return Value: // None. // global proc ImportClipToCharCallback (string $parent, int $doIt) { setParent $parent; if (`radioButtonGrp -q -sl scheduleMethod` == 1) { optionVar -intValue ImportClipToTimeline 1; } else { optionVar -intValue ImportClipToTimeline 0; } if ($doIt) { performImportClipToChar false; addToRecentCommandQueue "performImportClipToChar false" "ImportClipToChar"; } } proc string ImportClipToCharWidgets( string $parent ) { setParent $parent; string $tabForm = `columnLayout -adjustableColumn true`; radioButtonGrp -numberOfRadioButtons 1 -label "Clip" -label1 "Put Clip in Visor Only" -annotation "Put Clip in Visor Only: The clip is put in the Visor for later use." moveToLibraryMethod; radioButtonGrp -numberOfRadioButtons 1 -label1 "Put Clip in Trax Editor and Visor" -annotation "Put Clip in Trax Editor and Visor: The clip is placed in the Trax editor for immediate use. The clip is also put in the Visor for later use." -shareCollection moveToLibraryMethod scheduleMethod; return $tabForm; } global proc ImportClipToCharOptions () { string $commandName = "ImportClipToChar"; string $applyTitle = "Create"; // Build the option box "methods" // string $callback = ($commandName + "Callback"); string $setup = ($commandName + "Setup"); // Get the option box. // // The value returned is the name of the layout to be used as // the parent for the option box UI. // string $layout = getOptionBox(); setParent $layout; setOptionBoxCommandName("clip"); setUITemplate -pushTemplate DefaultTemplate; waitCursor -state 1; tabLayout -scr true -tv false; // To get the scroll bars string $parent = `columnLayout -adjustableColumn 1`; ImportClipToCharWidgets $parent; waitCursor -state 0; setUITemplate -popTemplate; // 'Apply' button. // string $applyBtn = getOptionBoxApplyBtn(); button -edit -label "Import Clip" -command ($callback + " " + $parent + " " + 1) $applyBtn; // 'Save' button. // string $saveBtn = getOptionBoxSaveBtn(); button -edit -command ($callback + " " + $parent + " " + 0 + "; hideOptionBox") $saveBtn; // 'Reset' button. // string $resetBtn = getOptionBoxResetBtn(); button -edit -command ($setup + " " + $parent + " " + 1) $resetBtn; // Set the option box title. // setOptionBoxTitle("Import Clip To Character Options"); // Customize the 'Help' menu item text. // setOptionBoxHelpTag( "Import Clip" ); // Set the current values of the option box. // eval (($setup + " " + $parent + " " + 0)); // Show the option box. // showOptionBox(); } // // Procedure Name: // assembleCmd // // Description: // Construct the command that will apply the option box values. // // Input Arguments: // None. // // Return Value: // None. // proc string assembleCmd() { string $cmd; setOptionVars(false); // check whether to schedule the clip int $toTimeline = 1; if (`optionVar -exists ImportClipToTimeline`) { $toTimeline = `optionVar -query ImportClipToTimeline`; } // doImportClipArgList takes a string array // $cmd = "doImportClipArgList 3 { " + "\"1\"" + ",\"" + $toTimeline + "\"" + " };"; return $cmd; } // // Procedure Name: // performImportClipToChar // // Description: // Import the clip. This procedure will also show the option box // window if necessary as well as construct the command string // that will import the clip with the current option box values. // // Input Arguments: // 0 - Execute the command. // 1 - Show the option box dialog. // 2 - Return the command. // // Return Value: // None. // global proc string performImportClipToChar (int $action) { string $cmd = ""; switch ($action) { // Execute the command. // case 0: // Retrieve the option settings // setOptionVars(false); // Get the command. // $cmd = `assembleCmd`; // Execute the command with the option settings. // evalEcho($cmd); break; // Show the option box. // case 1: ImportClipToCharOptions; break; case 2: // Get the command. // $cmd = `assembleCmd`; } return $cmd; }